//
//  CYMeContainerVC.m
//  CreditAddressBook
//
//  Created by Lee on 15/7/26.
//  Copyright (c) 2015年 Lee. All rights reserved.
//

#import "CYMeContainerVC.h"
#import "BaseBarButtonItem.h"
#import "CYJumpsTool.h"
#import "CYUser.h"
#import "CYShopViewController.h"
#import "CYLoginHttpTool.h"
#import "CYMeHttpTool.h"
#import "CreditWebViewController.h"
#import "MBProgressHUD+MJ.h"

@interface CYMeContainerVC ()

@property (weak, nonatomic) IBOutlet BaseBarButtonItem *shopBtn;
@end

@implementation CYMeContainerVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.automaticallyAdjustsScrollViewInsets = NO;
}
- (IBAction)shopBtnClick:(BaseBarButtonItem *)sender {

    CYUser *user = [CYLoginHttpTool userData].user;
//    MBProgressHUD *hud=[MBProgressHUD showHUDAddedTo:self.view animated:YES];
//    hud.mode=MBProgressHUDAnimationFade;//枚举类型不同的效果
//    hud.labelText=@"跳转中...";
    if (user) {
//        [CYMeHttpTool ShopwithaddressWithParams:@{@"userId":user.userId, @"token": user.token} success:^(NSString *message) {
//            
//
//                  } failure:^(NSError *error) {
//        [MBProgressHUD hideHUDForView:self.view animated:YES];
//        }];
        CYShopViewController *spvc = [[CYShopViewController alloc] init];
        spvc.hidesBottomBarWhenPushed = YES;
        
//        [MBProgressHUD hideHUDForView:self.view animated:YES];
        [self.navigationController pushViewController:spvc animated:YES];
    } else{
        [CYJumpsTool jumpToLogin:self];
//        [MBProgressHUD hideHUDForView:self.view animated:YES];
    }
    
}
@end
